package com.yuyue.dronesystem.beans;

import java.util.Objects;

/**
 * RTCoordinate
 */
public class RTCoordinate extends Coordinate {

    // 时刻（秒）
    private Long moment;

    public RTCoordinate() {
    }

    public RTCoordinate(Long moment) {
        this.moment = moment;
    }

    public RTCoordinate(Double longitude, Double latitude, Long moment) {
        super(longitude, latitude, 0.0);
        this.moment = moment;
    }

    public RTCoordinate(Double longitude, Double latitude, Double altitude, Long moment) {
        super(longitude, latitude, altitude);
        this.moment = moment;
    }

    public Long getMoment() {
        return this.moment;
    }

    public void setMoment(Long moment) {
        this.moment = moment;
    }

    public RTCoordinate moment(Long moment) {
        this.moment = moment;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (o == this)
            return true;
        if (!(o instanceof RTCoordinate)) {
            return false;
        }
        RTCoordinate rTCoordinate = (RTCoordinate) o;
        return super.equals((Coordinate) o) && Objects.equals(moment, rTCoordinate.moment);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), moment);
    }

    @Override
    public String toString() {
        return "{" +
            " coor='" + super.toString() + "'" +
            " moment='" + getMoment() + "'" +
            "}";
    }
}